#ifndef DRIVER_PORT_H
#define DRIVER_PORT_H
#include "stdbool.h"
#include "w25qxx.h"

struct driver_w25qxx_struct_def
{
    bool (*init)(void);

    void (*erase_chip)(void);
    void (*erase_sector)(uint32_t SectorAddr);
    void (*erase_block)(uint32_t BlockAddr);

    void (*write_byte)(uint8_t pBuffer, uint32_t Bytes_Address);
    void (*write_page)(uint8_t *pBuffer, uint32_t Page_Address, uint32_t OffsetInByte, uint32_t NumByteToWrite_up_to_PageSize);
    void (*write_sector)(uint8_t *pBuffer, uint32_t Sector_Address, uint32_t OffsetInByte, uint32_t NumByteToWrite_up_to_SectorSize);
    void (*write_block)(uint8_t *pBuffer, uint32_t Block_Address, uint32_t OffsetInByte, uint32_t NumByteToWrite_up_to_BlockSize);

    void (*read_byte)(uint8_t *pBuffer, uint32_t Bytes_Address);
    void (*read_page)(uint8_t *pBuffer, uint32_t Page_Address, uint32_t OffsetInByte, uint32_t NumByteToRead_up_to_PageSize);
    void (*read_sector)(uint8_t *pBuffer, uint32_t Sector_Address, uint32_t OffsetInByte, uint32_t NumByteToRead_up_to_SectorSize);
    void (*read_block)(uint8_t *pBuffer, uint32_t Block_Address, uint32_t OffsetInByte, uint32_t NumByteToRead_up_to_BlockSize);
    void (*task)(void);
    void (*tx_cpl_callback)(void);
    void (*rx_cpl_callback)(void);
};

extern struct driver_w25qxx_struct_def driver_w25qxx_struct;

#endif